package com.yuntai.pms.model.enums;


import java.util.LinkedHashMap;
import java.util.Map;

public enum DegradeRuleType {

    AVERAGERESPONSETIME(0, "平均响应时间RT"),
    EXCEPTIONRATIOPERSECOND(1, "每秒单元的异常比例"),
    LASTMINUTEEXCEPTION(2,"最近一分钟的异常数");

    private Integer code;
    private String name;
    private final  static Map<Integer,String> degradeRuleTypeMap = new LinkedHashMap<Integer,String>();

    public static Map<Integer, String> getDegradeRuleTypeMap() {
        return degradeRuleTypeMap;
    }

    static   {
        degradeRuleTypeMap.put(DegradeRuleType.AVERAGERESPONSETIME.getCode(), DegradeRuleType.AVERAGERESPONSETIME.getName());
        degradeRuleTypeMap.put(DegradeRuleType.EXCEPTIONRATIOPERSECOND.getCode(), DegradeRuleType.EXCEPTIONRATIOPERSECOND.getName());
        degradeRuleTypeMap.put(DegradeRuleType.LASTMINUTEEXCEPTION.getCode(), DegradeRuleType.LASTMINUTEEXCEPTION.getName());
    }
    private DegradeRuleType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
